package com.karst.webnotes.chapter04
{
	import flash.events.Event;
	
	import org.aswing.AsWingManager;
	import org.papervision3d.materials.WireframeMaterial;
	import org.papervision3d.objects.primitives.Cone;
	import org.papervision3d.view.BasicView;
	
	internal class WmExample extends BasicView
	{
		public function WmExample()
		{
			super() ;
			AsWingManager.getStage().frameRate = 24 ;
			createView() ;
			startRendering() ;
		}
		
		private var material : WireframeMaterial = null ;
		private var cone : Cone = null ;
		private function createView() : void
		{
			if( material == null )
				material = new WireframeMaterial( 0x000000, 0.5, 2 ) ;
			if( cone == null )
				cone = new Cone( material, 300, 500 ) ;
			scene.addChild( cone ) ;
		}
		
		override protected function onRenderTick( event : Event = null ) : void
		{
			super.onRenderTick( event ) ;
			cone.localRotationY-- ;
		}
	}
}